//
//  Student.m
//  OC02_作业
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Student.h"

@implementation Student
//- (void)setName:(NSString *)name {
//    _name = name;
//}
//- (NSString *)name {
//    return _name;
//}
//
//- (void)setAge:(NSInteger)age {
//    _age = age;
//}
//- (NSInteger)age {
//    return _age;
//}

- (instancetype)initWithName:(NSString *)name
                         age:(NSInteger)age {
    self = [super init];
    if (self) {
        _name = name;
        _age = age;
    }
    return self;
}

+ (instancetype)studentWithName:(NSString *)name
                            age:(NSInteger)age {
    Student *stu = [[Student alloc] initWithName:name age:age];
    return stu;
}
@end
